#include "./../Include/public.h"
void course_input_file()
{
	FILE *fp = NULL;
	struct course* p=head_course;
	fp = fopen("./data/course.txt","r");
	
	while (!feof(fp)) {     //判断文件是否结尾 
		struct course* node = (struct course*)malloc(sizeof(struct course));
		fscanf(fp, "%d %s %s %d %d %d %d", &node->cno,node->cname,node->type,&node->ctime,&node->score,&node->chose,&node->limit);
		if (p == NULL) {
			head_course = node;
			p = node;
		} else {
			p->next = node;
			p = node;
		}
	}
	p->next = NULL;
	//处理最后的情况
	p = head_course;
	while (p->next->next != NULL) {
		p = p->next;
	} 
	p->next = NULL;
	fclose(fp); 

}
